package sepe.chenli.unit3.task3_3;

public class FinanceInfo2 {
    private String companyName;
    private double earnestIncome;
    private double depositIncome;
    private double rentIncome;
    private double ohterIncome;
    private double staffCost;
    private double rentCost;
    private double hydropowerCost;
    private double taxCost;
    private double otherCost;

    public FinanceInfo2() {
        System.out.println("使用无参数构造方法创建财务信息对象!");
    }

    public FinanceInfo2(String companyName, double earnestIncome, double depositIncome, double rentIncome,
                        double ohterIncome, double staffCost, double rentCost, double hydropowerCost,
                        double taxCost, double otherCost) {
        super();
        System.out.println("使用带参数的构造方法创建财务信息对象: ");
        this.companyName = companyName;
        this.earnestIncome = earnestIncome;
        this.depositIncome = depositIncome;
        this.rentIncome = rentIncome;
        this.ohterIncome = ohterIncome;
        this.staffCost = staffCost;
        this.rentCost = rentCost;
        this.hydropowerCost = hydropowerCost;
        this.taxCost = taxCost;
        this.otherCost = otherCost;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public void setEarnestIncome(double earnestIncome) {
        this.earnestIncome = earnestIncome;
    }

    public void setDepositIncome(double depositIncome) {
        this.depositIncome = depositIncome;
    }

    public void setRentIncomme(double rentIncomme) {
        this.rentIncome = rentIncomme;
    }

    public void setOtherIncome(double otherIncome) {
        this.ohterIncome = otherIncome;
    }

    public void setStaffCost(double staffCost) {
        this.staffCost = staffCost;
    }

    public void setRentCost(double rentCost) {
        this.rentCost = rentCost;
    }

    public void setHydropowerCost(double hydropowerCost) {
        this.hydropowerCost = hydropowerCost;
    }

    public void setTaxCost(double taxCost) {
        this.taxCost = taxCost;
    }

    public void setOtherCost(double otherCost) {
        this.otherCost = otherCost;
    }
    public double calIncome() {
        double sumIncome = earnestIncome + depositIncome + rentIncome + ohterIncome;
        return sumIncome;
    }

    public double calCost() {
        double sumCost = staffCost + rentCost + hydropowerCost + taxCost + otherCost;
        return sumCost;
    }

    public double calNetIncome() {
        System.out.println(companyName + "的净收入计算结果: ");
        double netIncome = calIncome() - calCost();
        return netIncome;
    }
}